/* ==================== 全局样式 ==================== */
#main-app {
    min-height: 100vh;
    background: #f0f2f5;
}

/* ==================== 顶部导航栏 ==================== */
.header-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-left .logo {
    color: white;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.logo-icon {
    font-size: 28px;
}

.nav-center .el-menu {
    border-bottom: none !important;
}

.nav-center .el-menu-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.alarm-badge {
    margin-left: 5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.time-display {
    color: white;
    font-size: 14px;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

/* ==================== 主内容区 ==================== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== 页面头部 ==================== */
.page-header {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ==================== 统计卡片 ==================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px 0 rgba(0,0,0,.15);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.stat-card-primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card-success .stat-icon {
    background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
}

.stat-card-warning .stat-icon {
    background: linear-gradient(135deg, #e6a23c 0%, #f39c12 100%);
}

.stat-card-danger .stat-icon {
    background: linear-gradient(135deg, #f56c6c 0%, #ff4949 100%);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #909399;
    margin-bottom: 5px;
}

.stat-desc {
    font-size: 12px;
    color: #c0c4cc;
}

/* ==================== 内容区块 ==================== */
.content-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

.section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== 门店卡片网格 ==================== */
.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.shop-card {
    background: white;
    border: 2px solid #e4e7ed;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px 0 rgba(0,0,0,.15);
}

.shop-card-normal {
    border-color: #67c23a;
}

.shop-card-warning {
    border-color: #e6a23c;
}

.shop-card-danger {
    border-color: #f56c6c;
}

.shop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f2f5;
}

.shop-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.shop-card-body {
    margin-bottom: 15px;
}

.shop-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #606266;
    font-size: 14px;
}

.shop-card-footer {
    padding-top: 15px;
    border-top: 1px solid #f0f2f5;
}

.sensor-status {
    display: flex;
    justify-content: space-around;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.sensor-status-inline {
    display: flex;
    gap: 8px;
}

/* ==================== 传感器卡片 ==================== */
.sensors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.sensor-card-mini {
    background: white;
    border: 2px solid #e4e7ed;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.sensor-card-mini:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px 0 rgba(0,0,0,.1);
}

.sensor-card-closed {
    border-color: #67c23a;
}

.sensor-card-open {
    border-color: #f56c6c;
}

.sensor-card-offline {
    border-color: #909399;
    opacity: 0.7;
}

.sensor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sensor-id {
    font-size: 14px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 5px;
    word-break: break-all;
}

.sensor-location {
    font-size: 12px;
    color: #909399;
    margin-bottom: 10px;
}

.sensor-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #606266;
}

.sensor-status {
    display: flex;
    justify-content: center;
}

/* ==================== 详情页 ==================== */
.detail-page {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.info-card {
    margin-bottom: 20px;
}

/* ==================== 实时数据显示 ==================== */
.realtime-data {
    padding: 10px 0;
}

.data-section {
    margin-bottom: 30px;
}

.data-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #303133;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.data-item {
    background: #f5f7fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s;
}

.data-item:hover {
    background: #e6e8eb;
    transform: scale(1.05);
}

.data-item-highlight {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border: 2px solid #667eea;
}

.data-label {
    font-size: 12px;
    color: #909399;
    margin-bottom: 8px;
}

.data-value {
    font-size: 24px;
    font-weight: bold;
    color: #303133;
}

/* ==================== 表格样式 ==================== */
.el-table {
    box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
    border-radius: 8px;
}

.el-table tr {
    transition: background-color 0.3s;
}

.el-table tr:hover {
    background-color: #f5f7fa !important;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }
    
    .nav-center .el-menu {
        width: 100%;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .shops-grid {
        grid-template-columns: 1fr;
    }
    
    .sensors-grid {
        grid-template-columns: 1fr;
    }
    
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== 电力设备页面样式 ==================== */
.power-devices-page {
    animation: fadeIn 0.3s;
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-overview .stat-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid #e4e7ed;
}

.stats-overview .stat-item.stat-success {
    border-color: #67c23a;
}

.stats-overview .stat-item.stat-danger {
    border-color: #f56c6c;
}

.stats-overview .stat-item.stat-warning {
    border-color: #e6a23c;
}

.stats-overview .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #303133;
    margin-bottom: 8px;
}

.stats-overview .stat-label {
    font-size: 14px;
    color: #606266;
}

.power-devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.power-device-card {
    background: white;
    border: 2px solid #e4e7ed;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
}

.power-device-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.power-device-card.device-power-off {
    border-color: #67c23a;
    background: linear-gradient(135deg, #f0f9ff 0%, #e6fffa 100%);
}

.power-device-card.device-power-on {
    border-color: #f56c6c;
    background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
}

.power-device-card.device-offline {
    border-color: #909399;
    background: linear-gradient(135deg, #f5f7fa 0%, #f4f4f5 100%);
    opacity: 0.7;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.device-info h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #303133;
}

.device-id {
    font-size: 12px;
    color: #909399;
}

.device-body {
    text-align: center;
}

.power-status {
    margin-bottom: 20px;
}

.status-text {
    margin-top: 10px;
    font-size: 16px;
    font-weight: 500;
    color: #606266;
}

.device-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f2f5;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.detail-item .label {
    font-size: 12px;
    color: #909399;
}

.detail-item .value {
    font-size: 14px;
    color: #606266;
}

/* ==================== 页面特定样式 ==================== */
.overview-page,
.shops-page,
.sensors-page,
.power-devices-page,
.alarms-page {
    animation: fadeIn 0.3s;
}

